package com.lcz.demo.customerorder;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@RequestMapping(path="api/v1/customer")
@RestController
@Deprecated
//控制器
public class CustomerController {
private final CustomerService customerService;

    public CustomerController(CustomerService customerService) {
        this.customerService = customerService;
    }
@GetMapping
    List<Customer>getCustomers(){
        return customerService.getCustomers();
}
@PostMapping
    void createCustomer(@RequestBody Customer customer){
    System.out.println("POST 请求..");
    System.out.println(customer);
}
@PutMapping
    void updateCustomer(@RequestBody Customer customer){
    System.out.println("UNPDATE ...");
    System.out.println(customer);
}
@DeleteMapping(path = {"{customerId}"})
    void deleteCustomer(@PathVariable("customerId") Long id){
    System.out.println("DELETE 请求 删除customer 其ID"+id);
}


}
